xen/arm32: head: Introduce get_table_slot() and use it
authorJulien Grall <jgrall@amazon.com>
Fri, 12 Aug 2022 19:24:42 +0000 (20:24 +0100)
committerJulien Grall <julien@xen.org>
Wed, 31 Aug 2022 19:16:22 +0000 (20:16 +0100)
commitf93f7f70deca381e232968dc21da16522f28da6a
tree0d899d555fb57db01c28a21987bc8a5378d17bca
parent0f94a5a7fb5fbf50979227b54f82577f8bb51b65
xen/arm32: head: Introduce get_table_slot() and use it

There are a few places in the code that need to find the slot at a
given page-table level.

So create a new macro get_table_slot() for that. This will reduce
the effort to figure out whether the code is doing the right thing.

The new macro is using 'ubfx' (or 'lsr' for the first level) rather
than the existing sequence (mov_w, lsr, and) because it doesn't require
a scratch register and reduce the number of instructions (4 -> 1).

Signed-off-by: Julien Grall <jgrall@amazon.com>
Reviewed-by: Bertrand Marquis <bertrand.marquis@arm.com>
Tested-by: Bertrand Marquis <bertrand.marquis@arm.com>
Reviewed-by: Wei Chen <Wei.Chen@arm.com>
xen/arch/arm/arm32/head.S